package com.topfinance.xml;

public class MsgType {
	//{ "com.topfinance.xml.pacs.v00800102", "ibps.101.001.01", "FIToFICstmrCdtTrf",
	//"com.topfinance.xml.handler.ibps.Msg101Handler","IO" "10","GNRL"},
	
	//生成的处理包名
	String pkg;
	//消息编号
	String type;
	//操作标识符
	String oper;
	//解析处理程序
	String handler;
	//方向
	String flow;
	//实时、非实时
	String timing;
	//队列名称
	String queue;
	
	public MsgType() {
		super();
	}
	
	public MsgType(String[] msgs) throws Exception{
		if(msgs == null || msgs.length!=7)
			throw new Exception("Ileagal Data");
		this.pkg = msgs[0];
		this.type = msgs[1];
		this.oper = msgs[2];
		this.handler = msgs[3];
		this.flow = msgs[4];
		this.timing = msgs[5];
		this.queue = msgs[6];
	}
	
	public MsgType(String msgPkg, String msgType, String msgOper, String msgHandler, String msgFlow, String msgTiming, String queueType) {
		super();
		this.pkg = msgPkg;
		this.type = msgType;
		this.oper = msgOper;
		this.handler = msgHandler;
		this.flow = msgFlow;
		this.timing = msgTiming;
		this.queue = queueType;
	}

	public String getMsgFlow() {
		return flow;
	}

	public void setMsgFlow(String msgFlow) {
		this.flow = msgFlow;
	}

	public String getMsgHandler() {
		return handler;
	}

	public void setMsgHandler(String msgHandler) {
		this.handler = msgHandler;
	}

	public String getMsgOper() {
		return oper;
	}

	public void setMsgOper(String msgOper) {
		this.oper = msgOper;
	}

	public String getMsgPkg() {
		return pkg;
	}

	public void setMsgPkg(String msgPkg) {
		this.pkg = msgPkg;
	}

	public String getMsgTiming() {
		return timing;
	}

	public void setMsgTiming(String msgTiming) {
		this.timing = msgTiming;
	}

	public String getMsgType() {
		return type;
	}

	public void setMsgType(String msgType) {
		this.type = msgType;
	}

	public String getQueueType() {
		return queue;
	}

	public void setQueueType(String queueType) {
		this.queue = queueType;
	}
	
	public String toString(){
		StringBuffer msg = new StringBuffer();
		msg.append("{");
		msg.append("\"").append(this.pkg).append("\",");
		msg.append("\"").append(this.type).append("\",");
		msg.append("\"").append(this.oper).append("\",");
		msg.append("\"").append(this.handler).append("\",");
		msg.append("\"").append(this.flow).append("\",");
		msg.append("\"").append(this.timing).append("\",");
		msg.append("\"").append(this.queue).append("\",");
		msg.append("}");
		return msg.toString();
	}
}
